package com.fh.controller.system.userphoto;

import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.fh.controller.base.BaseController;
import com.fh.entity.Page;
import com.fh.util.AppUtil;
import com.fh.util.ObjectExcelView;
import com.fh.util.PageData;
import com.fh.util.Jurisdiction;
import com.fh.util.Tools;
import com.fh.service.system.userphoto.UserPhotoManager;

/** 
 * 说明：用户头像
 * 创建人：FH Q313596790
 * 创建时间：2019-10-09
 */
@Controller
@RequestMapping(value="/userphoto")
public class UserPhotoController extends BaseController {
	
	String menuUrl = "userphoto/list.do"; //菜单地址(权限用)
	@Resource(name="userphotoService")
	private UserPhotoManager userphotoService;
	
	/**保存
	 * @param
	 * @throws Exception
	 */
	@RequestMapping(value="/save")
	public ModelAndView save() throws Exception{
		logBefore(logger, Jurisdiction.getUsername()+"新增UserPhoto");
		if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限
		ModelAndView mv = this.getModelAndView();
		PageData pd = new PageData();
		pd = this.getPageData();
		pd.put("USERPHOTO_ID", this.get32UUID());	//主键
		pd.put("USERNAME", "");	//用户名
		pd.put("PHOTO0", "");	//原图
		pd.put("PHOTO1", "");	//头像1
		pd.put("PHOTO2", "");	//头像2
		pd.put("PHOTO3", "");	//头像3
		userphotoService.save(pd);
		mv.addObject("msg","success");
		mv.setViewName("save_result");
		return mv;
	}
	
	
	
	
	
	
	
}
